package com.pi.pro.xcmg.am.was.web.report;

/**
 *
 */

import com.pi.pro.xcmg.am.common.vo.report.*;
import com.pi.pro.xcmg.am.common.vo.sys.Result;
import com.pi.wms.service.KanbanReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 报表(LED屏) 功能
 */
@Slf4j
@RestController("reportInboundReportContrller")
@RequestMapping("/api/wms/xcmg/report/kanban/inbound")
public class ReportInboundController {


    @Autowired
    private KanbanReportService kanbanReportService;

    @RequestMapping(value="/summary",method = RequestMethod.POST)
    @ResponseBody
    public Result summary(@RequestBody ReportQueryDto queryParams){
        //
        Map<String, Object> query = new HashMap<>();
        query.put("divisioncode", queryParams.getDivisioncode());
        //
        InboundSummaryDailyReportDto summaryInfo = null;
        summaryInfo =kanbanReportService.summaryInboundDailyData(query);
        return new Result().success().data(summaryInfo);
    }

    @RequestMapping(value="/listdocumentdetails",method = RequestMethod.POST)
    @ResponseBody
    public Result listdocumentdetails(@RequestBody ReportPageQueryDto queryParams){
        //
        Map<String, Object> query = new HashMap<>();
        query.put("divisioncode", queryParams.getDivisioncode());
        //
        List<CommonDocumentDetailsDto> detailsData = null;
        detailsData =kanbanReportService.queryInboundTodayDocumentData(query, queryParams);
        return new Result().success().data(detailsData);
    }

    @RequestMapping(value="/listreceivetrans",method = RequestMethod.POST)
    @ResponseBody
    public Result listreceivetrans(@RequestBody ReportPageQueryDto queryParams){
        //
        Map<String, Object> query = new HashMap<>();
        query.put("divisioncode", queryParams.getDivisioncode());
        //
        List<CommonTransDetailsDto> detailsData = null;
        detailsData =kanbanReportService.queryInboundReceiveTransData(query, queryParams);
        return new Result().success().data(detailsData);
    }

    @RequestMapping(value="/listholdstorage",method = RequestMethod.POST)
    @ResponseBody
    public Result listholdstorage(@RequestBody ReportPageQueryDto queryParams){
        //
        Map<String, Object> query = new HashMap<>();
        query.put("divisioncode", queryParams.getDivisioncode());
        //
        List<CommonInventoryDetailsDto> detailsData = null;
        detailsData =kanbanReportService.queryInboundHoldInventoryData(query, queryParams);
        return new Result().success().data(detailsData);
    }


}
